package com.hjw.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

@Getter
@Setter
public class Cart implements Serializable {
    private Integer id;  
    private Integer uid;  // 购物车转订单, 前端无需上传
    private Book book;    // 内嵌书本对象，购物车转订单 前端需要给 book.id 值就行， 其他留空  book: {id: 100}
    private Integer num;
    private Double price;
    @JsonFormat(pattern = "yyyy-MM-dd" ,timezone = "GMT+8")
    private Date tcreate;   //购物车转订单, 前端无需上传

    @Override
    public String toString() {
        return "Cart{" +
                "id=" + id +
                ", uid=" + uid +
                ", book=" + book +
                ", num=" + num +
                ", price=" + price +
                ", tcreate=" + tcreate +
                '}';
    }
}